# coding: utf-8
from PySide6.QtCore import Signal
from qfluentwidgets import FluentIcon as FIF, NavigationItemPosition

from common import SingleIcon
from components import NavigationInterface, NavigationButton
from .deployment_interface import DeploymentInterface
from .setting_interface import SettingInterface

class PyInstallerWindow(NavigationInterface):
    quitSignal = Signal()

    def __init__(self, parent=None):
        super().__init__(parent)
        self.deploymentInterface = DeploymentInterface(self)
        self.settingInterface = SettingInterface(self)

        self.quitBtn = NavigationButton(FIF.EMBED, '退出', self)
        self.__initWidgets()

    def __initWidgets(self):
        self.quitBtn.setCheckable(False)
        self.quitBtn.clicked.connect(self.quitSignal)
        # 初始化导航栏
        self.addSubInterface(self.deploymentInterface, SingleIcon.Deployment, self.tr('部署'.center(4, ' ')),
                             position=NavigationItemPosition.TOP)
        self.addSubInterface(self.settingInterface, SingleIcon.BasicSetting, self.tr('设置').center(4, ' '))

        self.navigationBar.addWidget('quit', self.quitBtn, position=NavigationItemPosition.BOTTOM)
